import { defineStore } from "pinia"
import { ref } from "vue";



export const UseLocationPonit = defineStore('LocationPonit', () => {

    const locationPointArr = ref([
        { name: '01区', locationId: 1, code: 'LOCATION_01', position: { top: '38%', left: '28%' }, popoverVisible: false, status: true, staticLabel: '01分区标签', alertLabel: '01分区标签_告警' },
        { name: '02区', locationId: 2, code: 'LOCATION_02', position: { top: '38%', left: '68%' }, popoverVisible: false, status: true, staticLabel: '02区标签', alertLabel: '02区标签_告警' },
        // { name: '03区', locationId: 3, code: 'LOCATION_03', position: { top: '25%', left: '68%' }, popoverVisible: false, status: true, staticLabel: '01分区标签', alertLabel: '01分区标签_告警' },
        // { name: '04区', locationId: 4, code: 'LOCATION_04', position: { top: '24%', left: '28%' }, popoverVisible: false, status: true, staticLabel: '02区标签', alertLabel: '02区标签_告警' },
    ])
    //初始化 ？
    const initPointData = () => {
        locationPointArr.value = [
            { name: '01区', locationId: 1, code: 'LOCATION_01', position: { top: '38%', left: '28%' }, popoverVisible: false, status: true, staticLabel: '01分区标签', alertLabel: '01分区标签_告警' },
            { name: '02区', locationId: 2, code: 'LOCATION_02', position: { top: '38%', left: '68%' }, popoverVisible: false, status: true, staticLabel: '02区标签', alertLabel: '02区标签_告警' },
            // { name: '03区', locationId: 3, code: 'LOCATION_03', position: { top: '25%', left: '68%' }, popoverVisible: false, status: true, staticLabel: '01分区标签', alertLabel: '01分区标签_告警' },
            // { name: '04区', locationId: 4, code: 'LOCATION_04', position: { top: '24%', left: '28%' }, popoverVisible: false, status: true, staticLabel: '02区标签', alertLabel: '02区标签_告警' },
        ]
    }
    const setPointData = (index: any) => {


        locationPointArr.value[index].status = false
    }
    return {
        locationPointArr,
        initPointData,
        setPointData
    }
}) 